UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FSOHknKNHsQFJ9VMB3Ou8bKYZKci98WJeFAr/iQHDmc=' 
WHERE 
  key_id = '20b5141bbc976a44f5577c80a3afd5a42ced537e96a7f9588a232b733d7e438c' 
  AND (
    token = 'FSOHknKNHsQFJ9VMB3Ou8bKYZKci98WJeFAr/iQHDmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027