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

Query time 0.00042