UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q2LxHbo/gALlAYFdHT8Sb31E218Yk5CBNbFNKTQUNGs='
WHERE
key_id = 'efc0cc96a4fdad88b76c6a06ee83f6e08739a004e61e2dd26f0136cd5a286f9b'
AND (
token = 'q2LxHbo/gALlAYFdHT8Sb31E218Yk5CBNbFNKTQUNGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)