UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NTkPWypz3I5NwU+VTgL7f+TJYc+cRXHObMqAi8rUn6E=' 
WHERE 
  key_id = '15f99d9f13340e2c034c6e777dbbce6072f910235276ed4e56360027f625c900' 
  AND (
    token = 'NTkPWypz3I5NwU+VTgL7f+TJYc+cRXHObMqAi8rUn6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029