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