UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '736hCyHQ4ViSJPjUnc8grFKSSa6gMnI4ZKFirqJgZnU=' 
WHERE 
  key_id = 'bb184e75417118017ad8b8cf4e8e8ceff90930a87f067830f0c7589ae9f01887' 
  AND (
    token = '736hCyHQ4ViSJPjUnc8grFKSSa6gMnI4ZKFirqJgZnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019