UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K5rRbU/59ewhEaRkjU33ODZI4Co7f7lRXW9pDiVeeh0='
WHERE
key_id = '360607a096d03ef335d0d4aee2ae44879f7f6251806824826ce9a5e934eabf39'
AND (
token = 'K5rRbU/59ewhEaRkjU33ODZI4Co7f7lRXW9pDiVeeh0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)