UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fti77EKG+sa2rOl1wsYN/DnQ+H/zoJDE7Bkrlhvp9DE='
WHERE
key_id = '42f76f0bb75f732e6964ccd73afa3e08f8de9288efb1e00b166f745a01ddee85'
AND (
token = 'fti77EKG+sa2rOl1wsYN/DnQ+H/zoJDE7Bkrlhvp9DE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)