UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hKZjwLx4YEKIseYtsyJ/yhlC9D0/JOUOVdcBpNcJavQ=' 
WHERE 
  key_id = 'c7d6db50a92d9aa9e3232a7b9d7c1b18a13de19c17c85d364ed54a3b8ab76bec' 
  AND (
    token = 'hKZjwLx4YEKIseYtsyJ/yhlC9D0/JOUOVdcBpNcJavQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027