UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6CnIqPEjHf9CFaw+ps8LE4TKlaFOJafl/UlYuJbfo18='
WHERE
key_id = 'f46dbcb92c2c675493bc12942e5fa23248b16bdc9807f62c95cb2b366197a276'
AND (
token = '6CnIqPEjHf9CFaw+ps8LE4TKlaFOJafl/UlYuJbfo18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)