UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9uG9EZ99nhEV6ntyO7RRWjgtcAOD5lpmLHixRkG5MrE='
WHERE
key_id = '71a67a8cd0574be86af9b11ff65976bee49d0db53f8586c0954368c9773153cd'
AND (
token = '9uG9EZ99nhEV6ntyO7RRWjgtcAOD5lpmLHixRkG5MrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)