UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TnxXBJs1jWdVPxJV2vS36AKaSk44UNhJGDq7BXni9iM=' 
WHERE 
  key_id = '85f7e0002ce1aba828157f4f42380c66ea45eccd1005d18360dc42cc2a824b71' 
  AND (
    token = 'TnxXBJs1jWdVPxJV2vS36AKaSk44UNhJGDq7BXni9iM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028