UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xBJQTQ1UKqnlsdOKFzJPl4Dw73zVa7s9u87Mk2aU1qM=' 
WHERE 
  key_id = 'fcc84ff33ac3f6ec8c728a5b538b5f14ee9988dd7dff8795e92da89a3a03f944' 
  AND (
    token = 'xBJQTQ1UKqnlsdOKFzJPl4Dw73zVa7s9u87Mk2aU1qM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075