UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gw9mV6QJBYsVpRJOezRlPyxBmwBItjs/jY/REwQ/rSM=' 
WHERE 
  key_id = '6eb32444c318cc3e7aeda12b06c991f7486a863223cd66f542f8f63fa98b8d59' 
  AND (
    token = 'gw9mV6QJBYsVpRJOezRlPyxBmwBItjs/jY/REwQ/rSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036