UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ijz9AFilD8NiFMECqQtSgvy/lUSDPl+/4K9JIF4Tl0M='
WHERE
key_id = 'e3cde729b891a5a2cb214a200bb2c1880438fd39b4d1da27a0c7964c30250db9'
AND (
token = 'Ijz9AFilD8NiFMECqQtSgvy/lUSDPl+/4K9JIF4Tl0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)