UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6l619zjDqPWPRgZ50rF5clNX3OUlaSw5b6Md3j0xD9g=' 
WHERE 
  key_id = '2b89eda11ccfa63ff2caa20265a6b65e34fc6536ebb14e6b399015fc746e891a' 
  AND (
    token = '6l619zjDqPWPRgZ50rF5clNX3OUlaSw5b6Md3j0xD9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076