UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iMp9t2RB4YY/uJ8ymxGJ64qXFPCL+pMKWFjSjRhtBjg='
WHERE
key_id = 'a3eae4ce88259b14dcc7934733575989745b3bbed9c9e1373bdd25975e5cf7d7'
AND (
token = 'iMp9t2RB4YY/uJ8ymxGJ64qXFPCL+pMKWFjSjRhtBjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)