UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's6cSMOTtODzcbrhxpy6VnR41SqP0/K2kgSMHscGq6zU='
WHERE
key_id = '9af5b0aee1ff84cd4908def2a0cd497e65ad8cd702cd4232271cf265d4e311db'
AND (
token = 's6cSMOTtODzcbrhxpy6VnR41SqP0/K2kgSMHscGq6zU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)