UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5FvUFRaL9VxwQudWd+HUdUoZEEPzGFGR7JQT5vMGn6c=' 
WHERE 
  key_id = 'fac6f67cb93783fce037e5cd1d93fe37ec5108b5676c961cd08cc1524e0cb3e4' 
  AND (
    token = '5FvUFRaL9VxwQudWd+HUdUoZEEPzGFGR7JQT5vMGn6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051