UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IpofN8HTwJc6W6MRDUbNN+WknG1/xzFhFk2A7UYpn04=' 
WHERE 
  key_id = '4c54435ec8e4ae3c1d8801cd217126ed9e55c57ebfe186b0d465f594fa37114f' 
  AND (
    token = 'IpofN8HTwJc6W6MRDUbNN+WknG1/xzFhFk2A7UYpn04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047