UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QnZycXAzug2TPg2v0ZWrFlIiCgUrwAApyfoOi+75UGc=' 
WHERE 
  key_id = '2d3cf1910274a30b4fafe1c97868f954c1d8d103e7511fd225048414ed00796a' 
  AND (
    token = 'QnZycXAzug2TPg2v0ZWrFlIiCgUrwAApyfoOi+75UGc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015