UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FrOGmelNFGMkYaCIrltntg2w3KYQWhNjm/k302GGGWg=' 
WHERE 
  key_id = '5546111ee4ec683653eab9efa67264417f603ef4076750e1b704ec7967195b26' 
  AND (
    token = 'FrOGmelNFGMkYaCIrltntg2w3KYQWhNjm/k302GGGWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027