UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gHeQ/RMvYRZaj7MCBlsfUCwKyKUgh7xAKeor4UxW4G4=' 
WHERE 
  key_id = '87734ae27c7eaa7cd90ab121ee05c3bd25979e311556225cd7aaa677ca755fb6' 
  AND (
    token = 'gHeQ/RMvYRZaj7MCBlsfUCwKyKUgh7xAKeor4UxW4G4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056