UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dV/vrdX60zKj9+bftX3BW08u/vrlNBRSxtEETShEhKo='
WHERE
key_id = 'e324608f0a0f886373353ff3fc982a96a94b41d3447eda619efa48b16051cfcd'
AND (
token = 'dV/vrdX60zKj9+bftX3BW08u/vrlNBRSxtEETShEhKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)