UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q/+wP3zzW2ULCfGPsoQoSE+7+/weCim1fSGNk3KsCZU=' 
WHERE 
  key_id = 'c5294484d343e0943a592bbf5949e162dd1d6f3aba1bef03eee861313e2cf744' 
  AND (
    token = 'q/+wP3zzW2ULCfGPsoQoSE+7+/weCim1fSGNk3KsCZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039