UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pF9MbqSoGi+pPCmRoew2xTs3weF42dZpg9fTyeZvDVY='
WHERE
key_id = 'd8fff093e17b648ff57a28c0067789f0fc15dc07ea8aa53c69bf7fae3a230c54'
AND (
token = 'pF9MbqSoGi+pPCmRoew2xTs3weF42dZpg9fTyeZvDVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)