UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ySAAQvyr4OrOYs8rMqYOzK19KWHscH7xy8wYTZ0Jiis=' 
WHERE 
  key_id = '0310a279dcaf64cf1c02550b2696b18e9abda0a821b48d13ab9e17a38999b6dc' 
  AND (
    token = 'ySAAQvyr4OrOYs8rMqYOzK19KWHscH7xy8wYTZ0Jiis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030