UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w3H8pzCnEnweMLNWqkeHKntvR3hVc7Wvscj4dCIKPKU=' 
WHERE 
  key_id = '969327449e98a6ce8f109e49ff7a301d419291431099ed005ad3432600d89c37' 
  AND (
    token = 'w3H8pzCnEnweMLNWqkeHKntvR3hVc7Wvscj4dCIKPKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019