UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oSWCDHBPsUjpoTmEessLTd8OuAUGkyoMgE//dmOJ3vs=' 
WHERE 
  key_id = 'a690f58d76540a52a61aa896cc48799f9caa5e6268bd9b09e16075e398b7568a' 
  AND (
    token = 'oSWCDHBPsUjpoTmEessLTd8OuAUGkyoMgE//dmOJ3vs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022