UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3vGsMhmwSYEji+GzkDXSNJMKnfrh00FyB3Byqh1sR/w='
WHERE
key_id = 'b96ab79da7f271206c720827cb49be3f9ec292f8f08d9ecdbea87d4b12ae2655'
AND (
token = '3vGsMhmwSYEji+GzkDXSNJMKnfrh00FyB3Byqh1sR/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)