UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sBeWBy+KKBESnxiqA8kVxNg4LFNim0ZEtyNrzhmA7uI='
WHERE
key_id = '7e6098db2cda03f3fda1de5bb861fb64f8c01db521a423d60bfd4ba40dce9069'
AND (
token = 'sBeWBy+KKBESnxiqA8kVxNg4LFNim0ZEtyNrzhmA7uI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)