UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fsDCBUwEH/lCeHXQYSzjjknZLsSg6+lR5qlewAAgtnw='
WHERE
key_id = '10ce67cbc895eaa930d784b1158345aae3272a28ad88aad51aa36c9e49542fcd'
AND (
token = 'fsDCBUwEH/lCeHXQYSzjjknZLsSg6+lR5qlewAAgtnw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)