UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NESd8+5hDVEAWZkmOAcQVlLebH/907G2ItR71MKibuE='
WHERE
key_id = '1346237545a434a2fe763acb12a628b1329bfd361152b41f704324132e5c88b3'
AND (
token = 'NESd8+5hDVEAWZkmOAcQVlLebH/907G2ItR71MKibuE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)