UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uViwEJcUS+qSMXrf2n/sJDIRDOYj5TX4CbN+Bykj8Uk='
WHERE
key_id = 'fde190c7ef6f8a1082dcbf1f0cbe4e957d208783cbdcb3dd53a85beb9a9639f9'
AND (
token = 'uViwEJcUS+qSMXrf2n/sJDIRDOYj5TX4CbN+Bykj8Uk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)