UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZCIOA+iY3XZbfUc2WLYYt20iQBrEAG6UWfg+ifEhUHY=' 
WHERE 
  key_id = '926afe217e6328784491615a8435ae2d95623860b5d3fa212878ec1682f563d5' 
  AND (
    token = 'ZCIOA+iY3XZbfUc2WLYYt20iQBrEAG6UWfg+ifEhUHY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030