UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '82fnsNPWHciRKNeY961rAniiWYQK5mFZAAQlhHx93lI=' 
WHERE 
  key_id = '076e44106aa209d6763c0da34b21500dc970db6090dcde3a71d786e78659d03e' 
  AND (
    token = '82fnsNPWHciRKNeY961rAniiWYQK5mFZAAQlhHx93lI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025