UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '97wr7I/Gf4+f3aEVv8T4hvkETPn7jUFkPfF37cSBG1c='
WHERE
key_id = '2fbcc6de1e9ebac721b0825088e10cefce0ef7b474ac8f9eb41e6f413b4d5b5d'
AND (
token = '97wr7I/Gf4+f3aEVv8T4hvkETPn7jUFkPfF37cSBG1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)