UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nUBhTC6qrSRLIToDUGyohN8kPSgW1GEEKRHg2q7v6JI=' 
WHERE 
  key_id = '8e4cea1f963de30ff081d5ca2dc05f2b0354d18fafecace8672ee0541081fa45' 
  AND (
    token = 'nUBhTC6qrSRLIToDUGyohN8kPSgW1GEEKRHg2q7v6JI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016