UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yOpnqTq4yjuhvwdsxJV3Chfs7NJ9g29YrjBdtklW8N0=' 
WHERE 
  key_id = '9378496858b70edadb1a832b87ce11f65b13d4488f792c33ae6bd93ac1a43e94' 
  AND (
    token = 'yOpnqTq4yjuhvwdsxJV3Chfs7NJ9g29YrjBdtklW8N0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029