UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ziu2tI+rPB/dZnr6f6z0An8Z/fnhkxyMxvo16Y+z2bU=' 
WHERE 
  key_id = 'b0bc3445881566c8e5ce413196569080f91cc6eb4999fd37a694fa92bd1c059d' 
  AND (
    token = 'ziu2tI+rPB/dZnr6f6z0An8Z/fnhkxyMxvo16Y+z2bU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032