UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yQAAzljA8dH1HKJ/u2kgqiCJKBJnR+JI9JLlteORoYg='
WHERE
key_id = 'ee9b4102dc6116e4714ba282099a23faf828cd40904aa996a2fda79649c78000'
AND (
token = 'yQAAzljA8dH1HKJ/u2kgqiCJKBJnR+JI9JLlteORoYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)