UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oFyNZwryXE76x/vA2K2GLmaXSPBgD9acFxRyFKgiaWE='
WHERE
key_id = '0c40839ecfc13aca1e2d82b73ca11744e6fad4ed1ebd6959ea1a3fb2c895a001'
AND (
token = 'oFyNZwryXE76x/vA2K2GLmaXSPBgD9acFxRyFKgiaWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)