UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M0ue6N2a0a11W5F9aUS0sgFDdPbwrPP2MpMXP03r9uU='
WHERE
key_id = 'fe8d818961323b83c9b29c1fcfa2d4e12771524ce1c996ce0d79b3547c035f8e'
AND (
token = 'M0ue6N2a0a11W5F9aUS0sgFDdPbwrPP2MpMXP03r9uU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)